package com.sfac.springboot.modules.common.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/common")
public class CommonController {

    /**
     * 127.0.0.1/common/403---get
     */
    @GetMapping("/403")
    public String errorPageFor403(ModelMap modelMap){
        modelMap.addAttribute("template", "common/403");
        return "index2";
    }

    /**
     * 127.0.0.1/common/404---get
     */
    @GetMapping("/404")
    public String errorPageFor404(ModelMap modelMap){
        modelMap.addAttribute("template", "common/404");
        return "index2";
    }

    /**
     * 127.0.0.1/common/500---get
     */
    @GetMapping("/500")
    public String errorPageFor500(ModelMap modelMap){
        modelMap.addAttribute("template", "common/500");
        return "index2";
    }
}
